#! /usr/bin env python
import os
import sys
import time
import commands
import datetime
def renamefile(filepath):
    orig_filename = os.listdir(filepath)
    for filename in orig_filename:
        base_filename = filename.split('.')[0]
        utc_seconds = int(time.mktime(datetime.datetime.now().timetuple()))
        now_filename = '.'.join([base_filename, str(utc_seconds)])
        cmd = "mv %s/%s %s/%s"% (filepath, filename, filepath, now_filename)
        status, output = commands.getstatusoutput(cmd)
        if status!= 0:
            print output
def create_load():
    filepath = sys.argv[1]
    while True:
        renamefile(filepath)
        time.sleep(2)

create_load()
